import { Graph } from "@antv/x6";
import * as FlowGraph from "../../core/create";
import { CustomGraphType } from "../type";
import ZMGraph from "./ZMGraph.vue";
import { BaseNodeConfigPanel } from "../../shared";
import { PORTS } from "../../default";

Graph.registerNode("ZMGraph", {
	inherit: "vue-shape",
	width: 30,
	height: 60,
	component: {
		template: `<ZMGraph />`,
		components: { ZMGraph }
	},
	ports: PORTS,
	data: {
		type: CustomGraphType.水闸,
		vue: true
	}
});

FlowGraph.install(CustomGraphType.水闸, ({ graph, appendStencil }) => {
	appendStencil([graph.createNode({ shape: "ZMGraph" })]);
	return { configPanel: BaseNodeConfigPanel };
});
